2020/12/06
Important Note.
This is about Raspberry 3, which runs the armhf architecture. See Raspberry Pie 4 for 64-bit build environments on RPi-4
Installing Raspbian
OpenCPN works on Raspberry Pi 2, 3 and 4 models. You can install OpenCPN adding an Ubuntu PPA (Personal Packages Archives) to your system's Software Sources. We will see how to do this but first of all you need to have a running system.
Raspbian is the official Operating System for Raspberry Pi. You have two options to install Raspbian on an SD card: with NOOBS (New Out Of Box Software) or installing an SD image directly. We recommend NOOBS.
Follow this easy guide for both options: https://www.raspberrypi.org/learning/software-guide/quickstart/
If you feel lazy you can try OpenPlotter, a complete marine Operating System for Raspberry Pi with OpenCPN + plugins installed and amazing extra tools ready to use. OpenPlotter can be installed with NOOBS following this guide: https://sailoog.gitbooks.io/openplotter-documentation/content/en/getting_started.html
See http://www.cruisersforum.com/forums/f134/opencpn-version-4-8-4-released-200246-2.html#post2627925 and the later posts from bdbcat and CaptRon. How do I fix the GPG error “NO_PUBKEY”? Apt-key is deprecated, see gpg: keyserver receive failed: No dirmngr and GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available
Once you have Raspbian running on Raspberry Pi, go to Menu → Accessories → Terminal, and type:
sudo nano /etc/apt/sources.list
A text editor will open. Move the cursor to the end and add this line if you are on Raspbian Stretch:
deb http://ppa.launchpad.net/opencpn/opencpn/ubuntu/ xenial main
Or, if your Raspbian is the latest Buster:
deb http://ppa.launchpad.net/opencpn/opencpn/ubuntu/ bionic main
Save the file pressing Ctrl X, say Yes and press enter. Now type:
sudo apt install dirmngr
(A certificate management service, needed for the next command) Then type
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C865EB40
and press enter. Now be sure you have Internet connection and type:
sudo apt-get update
The Software sources will be updated and finally you will have to type:
sudo apt-get install opencpn
and you are done!
See https://www.cruisersforum.com/forums/f134/rpi-hat-what-interface-for-gnss-244280.html#post3307322
For direct implementation with OpenCPN the easiest path is NMEA 0183, this is supported natively and directly by OpenCPN - no other decoding software widget would be required. O recognizes serial ports on the host directly - this is built-in functionality. On the NEO 8 NMEA is available on both the UART and USB interfaces:
9600 baud, 8 bits, no parity bit, 1 stop bit. Configured to transmit both NMEA and UBX protocols, but only the following NMEA (and no UBX) messages have been activated at start-up: GGA, GLL, GSA, GSV, RMC, VTG, TXT
Configured to transmit both NMEA and UBX protocols, but only the following NMEA (and no UBX) messages have been activated at start-up: GGA, GLL, GSA, GSV, RMC, VTG, TXT USB power mode: bus-powered On Linux OpenCPN should be able to access either port with built-in drivers, not much difference and not much configuration required, so whichever is easier to implement in the hat.
If, for some reason, you want to use SPI/DDC you could use the OpenPlotter installation to add some I2C support or write your own code, but that is a more difficult path for the stated purpose of integration with O (but there may be other reasons depending on alternate uses for your project).
To install or update plugins, use the Plugin-Manager of openCPN. Go to Options → Plugins and update the Plugin Catalog: Master. Scroll the plugin list to find the plugin you want to install or update. A green up arrow indicates that there is an update available. Select the the plugin and install or update it. Finally, enable the plugin.
It is suggested to use 'High Endurance' microSDHC cards. Google 'Wear Level' on SD cards to discover more information.
The latest version of Raspbian based on Debian Buster has OpenGL enabled by default if you are running it on a Raspberry 4.